attribute float positionIndex;
uniform float f_total;
uniform float f_time;
uniform float f_range;
uniform float f_size;
varying float v_opacity;

void main() {
    v_opacity = 0.0;
    float size = 10.0;
    float showIndex = f_total * mod(f_time, 1.0);
    if(positionIndex > showIndex && positionIndex < showIndex + f_range) {
        float index = (positionIndex - showIndex) / f_range;
        size = f_size * index;
        v_opacity = 1.0;
    }

    gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
    gl_PointSize = size;
}